<!--河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
-->
<template>
  <div>
    <el-form ref="form" :model="s_goods" :rules="rules" label-width="100px" id="mvcfm">
      <div class="form-unit">
        <span class="mvc-title-left"> 库存信息 </span>
      </div>
      <el-table :data="s_goods">
        <el-table-column label="操作" align="center" width='100' type=''>
          <template slot-scope="scope">
            <el-dropdown trigger="click">
              <span class="el-dropdown-link">操作<i class="el-icon-arrow-down el-icon--right"></i></span>
              <el-dropdown-menu slot="dropdown">
                <el-dropdown-item>
                  <el-link @click="gotoPage('/psi/supplychainmana/WarehouseStorage?CMID='+scope.row.product_id+''+vueparams+'')">入库记录</el-link>
                </el-dropdown-item>
                <el-dropdown-item>
                  <el-link @click="gotoPage('/psi/supplychainmana/WarehouseDelivery?CMID='+scope.row.product_id+''+vueparams+'')">出库记录</el-link>
                </el-dropdown-item>
              </el-dropdown-menu>
            </el-dropdown>
          </template>
        </el-table-column>
        <el-table-column label="条形码" prop="product_barcode">
        </el-table-column>
        <el-table-column label="名称" prop="product_name">
        </el-table-column>
        <el-table-column label="型号" prop="product_model">
        </el-table-column>
        <el-table-column label="规格" prop="product_norm">
        </el-table-column>
        <el-table-column label="入库数" prop="storagesum">
        </el-table-column>
        <el-table-column label="出库数" prop="deliverysum">
        </el-table-column>
        <el-table-column label="库存数" prop="">
        </el-table-column>
        <el-table-column label="排号" prop="district_line">
        </el-table-column>
        <el-table-column label="行号" prop="district_row">
        </el-table-column>
        <el-table-column label="格号" prop="district_rack">
        </el-table-column>
      </el-table>
    </el-form>
  </div>
</template>
<script>
  import request from '@/utils/request'
  export default {
    name: 'WarehouseGoods',
    components: {},
    props: ['popparams'],
    data() {
      return {
        vueparams: this.getVUEParams(""),
        s_goods: [],
        district_line: [],
        district_row: [],
        district_rack: [],
        loading: false,
        rules: {}
      }
    },
    created() {
      this.getData();
    },
    updated() {},
    mounted() {},
    methods: {
      getData() {
        request({
          method: 'get',
          url: '/xcapi/VUEAction/psi/supplychainmana/WarehouseGoods/warehouseGoods?' + this.vueparams,
        }).then(data => {
          for (var k in data) {
            if (Array.isArray(data[k])) {
              this[k] = data[k];
            } else {
              $.extend(this[k], data[k]);
            }
          }
        })
      },
      list_district_line(value) {
        if (this.$route.fullPath.indexOf("?") == -1) {
          this.$router.replace("/redirect" + this.$route.fullPath + "?CMIDSEL3=" + value);
        } else if (this.$route.fullPath.indexOf("CMIDSEL3=") == -1) {
          this.$router.replace("/redirect" + this.$route.fullPath + "&CMIDSEL3=" + value);
        } else {
          this.gotoPage("/redirect/psi/supplychainmana/WarehouseGoods?" + this.vueparams, {
            CMIDSEL3: value
          });
        }
      },
      list_district_row(value) {
        if (this.$route.fullPath.indexOf("?") == -1) {
          this.$router.replace("/redirect" + this.$route.fullPath + "?CMIDSEL4=" + value);
        } else if (this.$route.fullPath.indexOf("CMIDSEL4=") == -1) {
          this.$router.replace("/redirect" + this.$route.fullPath + "&CMIDSEL4=" + value);
        } else {
          this.gotoPage("/redirect/psi/supplychainmana/WarehouseGoods?" + this.vueparams, {
            CMIDSEL4: value
          });
        }
      },
      list_district_rack(value) {
        if (this.$route.fullPath.indexOf("?") == -1) {
          this.$router.replace("/redirect" + this.$route.fullPath + "?CMIDSEL2=" + value);
        } else if (this.$route.fullPath.indexOf("CMIDSEL2=") == -1) {
          this.$router.replace("/redirect" + this.$route.fullPath + "&CMIDSEL2=" + value);
        } else {
          this.gotoPage("/redirect/psi/supplychainmana/WarehouseGoods?" + this.vueparams, {
            CMIDSEL2: value
          });
        }
      },
    },
  }
</script>
